package tw.com.softleader.spring.service.impl;

import java.util.List;

import org.springframework.util.StringUtils;

import tw.com.softleader.spring.dao.SpringDao;
import tw.com.softleader.spring.service.SpringService;

public class SpringServiceImpl implements SpringService{
	
	private String greeting;
	
	private List<String> vendors;
	
	private SpringDao dao;
	
	public String getHello(String name){
		return StringUtils.collectionToCommaDelimitedString(vendors)+" "+greeting +" "+ name;
	}
	
	public String getAll(){
		return StringUtils.collectionToCommaDelimitedString(dao.findAll());
	}
	
	public void setGreeting(String greeting){
		this.greeting = greeting;
	}
	
	public void setVendors(List<String> vendors) {
		this.vendors = vendors;
	}
	
	public void setDao(SpringDao springDao) {
		this.dao = springDao;
	}
}
